const app = getApp()
const {viewHeight} = app.globalData
import {findRepairByUserId} from "../../../api/repair"
import {getUserInfo} from "../../../api/userInfo"


Page({

  /**
   * 页面的初始数据
   */
  data: {
    repairList:[],
    limit:3,
    skip:0
  },

  /**
   * 生命周期函数--监听页面加载
   */
  async onShow(options) {
    let {_id} = await getUserInfo()

    let limit = Math.ceil(viewHeight / 310)
    let ret = await findRepairByUserId(_id,limit,0)
    if(ret.code == 200){
      
      this.setData({
        repairList:ret.data
      })
    }
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    
  },

  toSelectService(){
    wx.navigateTo({
      url: '/pages/menu/repair/selectService/index',
    })
  },
})